package com.lxit.dao;

import com.lxit.pojo.Repertory;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface RepertoryMapper {
    @Delete({
        "delete from tb_repertory",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

    @Insert({
        "insert into tb_repertory (id, name)",
        "values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR})"
    })
    int insert(Repertory record);

    int insertSelective(Repertory record);

    @Select({
        "select",
        "id, name",
        "from tb_repertory",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @ResultMap("BaseResultMap")
    Repertory selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Repertory record);

    @Update({
        "update tb_repertory",
        "set name = #{name,jdbcType=VARCHAR}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(Repertory record);
}